﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
namespace ConfExpert.Forms.Depo
{
    public partial class AzTuketim2 : XForm
    {
        public AzTuketim2()
        {
            InitializeComponent();
        }

        private void AzTuketim2_Load(object sender, EventArgs e)
        {

            textEdit1.EditValue = 12;
            gvCust.Init("GetAzTuketim", intParse(textEdit1.EditValue));
            gvCust.AddDetailGrid(gvKumas, "CustomerId");

            gvKumas.FormatAsNumber(0, "DepoQty", "CikanQty");
            gvCust.FormatAsNumber(0, "TotalDepoQty");
            gvKumas.MakeColumnInvisible("ProductId");//, "CustomerId");
            gvKumas.AddSummary("DepoQty");
            gvCust.AddSummary("TotalDepoQty");
            gvKumas.BestFitColumns();
            gvCust.BestFitColumns();

            textEdit1.EditValueChanged += new EventHandler(textEdit1_EditValueChanged);
            splitContainerControl1.AutoSize();
        }

        void textEdit1_EditValueChanged(object sender, EventArgs e)
        {
            gvCust.RefreshDataSource(true, "GetAzTuketim", intParse(textEdit1.EditValue));
            //gvKumas.FormatAsNumber(0, "DepoQty", "CikanQty");
            //gvCust.FormatAsNumber(0, "TotalDepoQty");
            //gvKumas.MakeColumnInvisible("ProductId", "CustomerId");
            //gvKumas.AddSummary("DepoQty");
            //gvCust.AddSummary("TotalDepoQty");
            gvKumas.BestFitColumns();
            gvCust.BestFitColumns();

        }
    }
}
